#include <REGX52.H>
#include <INTRINS.H>
#include "delay.h"
#include "DS1302.h"
#include "LCD1602.h"


unsigned char Second = 0;
unsigned char Minute = 0;
unsigned char Hour = 0;
unsigned char Day = 0;
unsigned char Month = 0;
unsigned char Year = 0;
unsigned char Week = 0;




void main()
{
	
	DS1302_Init();
	LCD_Init();
	
	
	DS1302_SetTime();
	
	
	while(1)
	{
		DS1302_ReadTime();
		
		LCD_ShowString(1, 1, "  -  -");
		LCD_ShowNum(1, 1, DS1302_Time[0], 2);
		LCD_ShowNum(1, 4, DS1302_Time[1], 2);
		LCD_ShowNum(1, 7, DS1302_Time[2], 2);
		
		
		LCD_ShowString(2, 1, "  :  :");
		LCD_ShowNum(2, 1, DS1302_Time[3], 2);
		LCD_ShowNum(2, 4, DS1302_Time[4], 2);
		LCD_ShowNum(2, 7, DS1302_Time[5], 2);
		
		Delay(1000);
	}
}
